👉 Gathering math, also known as the law of total expectation, is a fundamental principle in probability theory that allows us to compute the expected value of a random variable by considering all possible outcomes of a larger, often complex, system. It states that if we have a set of mutually exclusive and exhaustive events \( B_1, B_2, \ldots, B_n \) that cover all possible scenarios, the expected value \( E[X] \) of a random variable \( X \) can be expressed as the sum of the product of each outcome \( x_i \) in the set and its probability \( P(B_i) \), mathematically represented as \( E[X] = \sum_{i=1}^n x_i P(B_i) \). This approach is particularly useful when dealing with conditional expectations and simplifies the calculation of expected values in situations where direct computation is infeasible due to the complexity of the underlying system.